import request from '@/utils/request'
// 获取企业列表
export const getEnterpriseListApi = (params) => request({ url: '/park/enterprise', params })

/**
 * 获取行业列表
 */
export const getIndustryListApi = () => request({ url: '/park/industry' })

/**
 * 上传合同
 */
export const uploadApi = (data) => request({ url: '/upload', method: 'POST', data })

/**
 * 新增公司
 */
export const addEnterpriseApi = (data) => request({ url: '/park/enterprise', method: 'POST', data })

// 获取企业详情
export const getEnterpriseDetailApi = (id) => request({ url: `/park/enterprise/${id}` })

// 更新企业详情
export const updateEnterpriseApi = (data) => request({ url: 'park/enterprise', method: 'PUT', data })

/**
 * 删除企业
 */
export const delEnterpriseApi = (id) => request({ url: `/park/enterprise/${id}`, method: 'DELETE' })

// 获取租赁楼宇
export const getRentBuildListApi = () => request({ url: '/park/rent/building' })

/**
 * 给当前企业添加合同
 */
export const createRentApi = (data) => request({ url: '/park/enterprise/rent', method: 'POST', data })

/**
 * 获取企业下合同列表
 */
export const getRentListApi = (id) => request({ url: `/park/enterprise/rent/${id}` })

/**
 * 退租
 */

export const outRentApi = (rentId) => request({ url: `/park/enterprise/rent/${rentId}`, method: 'PUT' })

/**
 * 下载合同文件
 */
export const downloadContractApi = (id) => request({ url: `/download/${id}`, responseType: 'blob' })

